layui.config({
  base: '/home_v2/common/',
}).extend({
  index: '/lib/index',
  soulTable: 'soulTable'
}).use(['table', 'index','form','laydate'],function () {
  let table = layui.table,laydate=layui.laydate;

  laydate.render({
    elem: '#yxrq'
  });
  laydate.render({
    elem: '#ywrq'
  });

  let pageLimit = {
    limit:20,
    curr:1
  }
  tableRenderFun()
  //表格渲染
  function tableRenderFun(){
    table.render({
      elem: '#tableList'    //渲染
      , method: 'get'   //请求方式
      , height: 'full-' + parseInt(config_v2.fontSize(1.35))
      , id: "tableList"
      , url: "tempData4.json"
      , defaultToolbar: []     //工具栏右侧隐藏
      , title: '单位信息表'
      , even: true
      , response: {statusCode: 200}
      , parseData: function (res) {  //res 即为原始返回的数据
        return {
          "code": res.code, //解析接口状态
          "msg": res.msg, //解析提示文本
          "count": res.data.total, //解析数据长度
          "data": res.data.records //解析数据列表
        };
      }
      , cols: [[   //表格绑数据
        {field: 'operate', type: 'checkbox', width: config_v2.fontSize(0.5)},
        {field: 'd1', title: '业务流程',align: 'left'},
        {field: 'd2', title: '业务日期', align: 'center', width: '12%'},
        {field: 'd3', title: '最早运行', align: 'center', width: '12%'},
        {field: 'd4', title: '最近结束', align: 'center', width: '12%'},
        {field: 'operate', title: '操作', align: 'center', width: config_v2.fontSize(1.7), templet: function (d) {
            return config_v2.listbut("DAG图", "", "", "dagBut")
          }
        }
      ]],
      request: {
        pageName: 'pageCurrent', //页码的参数名称，默认：page
        limitName: 'pageSize' //每页数据量的参数名，默认：limit
      },
      contentType: "application/json" //格式
      , headers: config_v2.headers('pageSysUnitInfoList')
      , page: pageLimit  //开启分页
      , limits: [20, 50, 100, 200, 500] //控制多少行一页（默认五条一页）
      , limit: 20
      , where: {
        page:1,
        limit: 20
      },
      done: function () {
        config_v2.tablelist();
      }
    });
  }
})


